package lyo.levelup.person.persontest;
public abstract class Person {
    private String name, surName;
    private double pay;
    private int countWork;
    private PersonType pt;
    Person(String name, String surName, double pay, int countWork, PersonType idType)
    {
        this.countWork = countWork;
        this.name = name;
        this.surName = surName;
        this.pay = pay;
        this.pt = idType;
    }

    public String getName() {
        return name;
    }

    public String getSurName() {
        return surName;
    }

    public double getPay() {
        return pay;
    }

    public int getCountWork() {
        return countWork;
    }    
    public double getSalaryPerson()
    {
      return getPay()*getCountWork();  
    }
    public void info()
    {      
         System.out.println(getName()+" "+getSurName()+" is "+pt.name()+" and his salary is "+getSalaryPerson()+"$");    
    }
}